﻿namespace Refract.Views
{
    using System;
    using System.ComponentModel.Composition;

    using Refract.MVVM;

    public interface IViewMetadata
    {
        #region Properties

        string SiteMapPath
        {
            get;
        }

        string Title
        {
            get;
        }

        #endregion Properties
    }

    [MetadataAttribute]
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public class ExportViewAttribute : ExportAttribute
    {
        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ExportViewAttribute"/> class.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="viewType">Type of the view.</param>
        public ExportViewAttribute(string title, Type viewType)
            : base(viewType)
        {
            Title = title;

            SiteMapPath = null;
        }

        #endregion Constructors

        #region Properties

        /// <summary>
        /// Gets or sets the site map path.
        /// </summary>
        /// <value>The site map path.</value>
        public string SiteMapPath
        {
            get; private set;
        }

        /// <summary>
        /// Gets or sets the title.
        /// </summary>
        /// <value>The title.</value>
        public string Title
        {
            get; private set;
        }

        #endregion Properties
    }
}